package com.example.poemtest.mine;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.Switch;

import com.example.poemtest.R;
import com.example.poemtest.utils.FullScreenUtil;

/**
 * 消息与通知页面
 */
public class MessageAndRemaindActivity extends AppCompatActivity implements View.OnClickListener{

    private ImageView back;
    private Switch aSwitch,aSwitch1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        FullScreenUtil.getInstance().fullScreen(this,true);
        setContentView(R.layout.activity_message_and_remaind);
        //绑定控件对象
        initData();
    }

    /**
     * 绑定控件对象
     */
    private void initData() {
        back = findViewById(R.id.setup_to_mine);
        back.setOnClickListener(this);
        aSwitch1 = findViewById(R.id.msg_remind);
        aSwitch1.setOnClickListener(this);
        aSwitch = findViewById(R.id.speak);
        aSwitch.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.setup_to_mine:
                //返回到设置页面
                Intent intent = new Intent(this,SetupActivity.class);
                startActivity(intent);
                break;
            case R.id.msg_remind:
                //点击消息提醒按钮
                aSwitch1.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
                    @Override
                    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                        //监听按钮是否被开启

                    }
                });
                break;
            case R.id.speak:
                //点击推荐按钮
                aSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
                    @Override
                    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                        //监听按钮是否被开启

                    }
                });
        }
    }
}